const express = require('express');
const router = new express.Router();

/**
 * @param {Object} options
 * @param {} options.code 编号
 * @param {} options.brandId 品牌Id
 * @param {} options.status 状态
 * @param {} options.name 银行名称和英文名称模糊查询
 * @param {} options.companyName 公司名称
 * @param {} options.account 银行账号
 * @param {} options.pageSize 每页数据量
 * @param {} options.pageIndex 指定页
 * @param {} options.sortField 排序字段
 * @param {} options.isDesc 倒序排列
 * @throws {Error}
 * @return {Promise}
 */
router.get('/', async(req, res, next) => {
    const options = {
        code: req.query.code,
        brandId: req.query.brandId,
        status: req.query.status,
        name: req.query.name,
        companyName: req.query.companyName,
        account: req.query.account,
        pageSize: req.query.pageSize,
        pageIndex: req.query.pageIndex,
        sortField: req.query.sortField,
        isDesc: req.query.isDesc
    };
    const data = {
        message: 'message',
        payload: {
            content: [
                {
                    id: 'id45',
                    brandCode: 'brandCode46',
                    brandName: 'brandName47',
                    code: 'code48',
                    name: 'name49',
                    account: 'account',
                    accountCode: 'accountCode50',
                    type: 1,
                    companyName: 'companyName51',
                    status: 1,
                    rowVersion: 'rowVersion',
                    options: [
                        'update',
                        'abandon'
                    ]
                },
                {
                    id: 'id52',
                    brandCode: 'brandCode53',
                    brandName: 'brandName54',
                    code: 'code55',
                    name: 'name56',
                    account: 'account',
                    accountCode: 'accountCode57',
                    type: 1,
                    companyName: 'companyName58',
                    status: 1,
                    rowVersion: 'rowVersion',
                    options: [
                        'update',
                        'abandon'
                    ]
                }
            ],
            pageIndex: null,
            pageSize: null,
            sort: null,
            totalElements: 50,
            totalPages: null
        }
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @throws {Error}
 * @return {Promise}
 */
router.post('/', async(req, res, next) => {
    const options = {
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @param {} options.id id
 * @throws {Error}
 * @return {Promise}
 */
router.get('/:id', async(req, res, next) => {
    const options = {
        id: req.params.id
    };
    const data = {
        message: 'message',
        payload: {
            id: 'id59',
            brandCode: 'brandCode60',
            brandName: 'brandName61',
            code: 'code62',
            name: 'name63',
            engName: 'engName64',
            account: 'account',
            accountCode: 'accountCode65',
            type: 1,
            companyName: 'companyName66',
            address: 'address',
            status: 1,
            rowVersion: 'rowVersion',
            options: [
                'update',
                'abandon'
            ]
        }
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @param {} options.id 开户银行Id
 * @throws {Error}
 * @return {Promise}
 */
router.put('/:id', async(req, res, next) => {
    const options = {
        id: req.params.id
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @param {} options.id 开户银行Id
 * @throws {Error}
 * @return {Promise}
 */
router.put('/:id/abandon', async(req, res, next) => {
    const options = {
        id: req.params.id
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});
module.exports = router;
